module HLibcell (someFunc) where
import HLibcell.HFunc
import HLibcell.IO


someFunc :: IO ()
someFunc = do
    putStrLn "someFunc"
    (nmesh,v )<-return $hmesh_create_vertexv [1,2,3] mesh 
    (nmesh,v )<-return $hmesh_create_vertexv [2,22,3] nmesh 
    (nmesh,v )<-return $hmesh_create_vertexv [3,22,3] nmesh 
    (nmesh,v)<- return $ hmesh_create_vertexv [4,1,2] nmesh 
    -- vs<-return $ [0,1,2]
    -- hfvids<-return $ [myfun (length vs) i [vs !!j|j<-[0..(length vs-1)],j/=i]|i<-[0..(length vs-1)]]
    -- putStrLn $show $ hfvids 
    (nmesh,v )<-return $hmesh_create_cellvi  [0,1,2] nmesh
    (nmesh,v)<-return $ hmesh_create_cellvi  [2,1,3] nmesh
    nmesh<- return $ hmesh_delete_celli 0 nmesh  
    --putStrLn $show $length $hmesh_get_vertices nmesh1
    hprint_mesh nmesh
    where 
        mesh=hmesh_create
        myfun::Int->Int->[a]->[a]
        myfun size i xs=if size>2&&mod (size-i-1) 2==1
            then 
                (\(y:ys)->(head ys):(y:(tail ys))) xs
            else
                xs  